/*
 * @Description: 
 * @Author: Aaron Peng
 * @Date: 2022-08-07 19:06:45
 * @LastEditTime: 2022-08-08 23:26:26
 * @LastEditors: Aaron Peng
 */
import axios from 'axios';
import React, { useEffect, useState } from 'react'
import "./index.scss"

const Ceo = () => {
    const [List01, setList01] = useState([]);
    const [List02, setList02] = useState([]);
    // const [List03, setList03] = useState([]);

    useEffect(() => {
        axios.post("https://srv.hotkidceo.com/appapi/api/root-ceo-content/ceoPage/pageList", { channelId: null, memberKey: "", roleKey: "", type: 1 }).then(res => {
            setList01(res.data.data[1].configureAttribute[0].list);
            setList02(res.data.data[1].configureAttribute[1].list);
            // setList03(res.data.data[3].configureAttribute.list);
        })
    }, [])
    return (
        <div>
            <div className='bg-img'></div>
            <div className='free'>
                <div className='title'>免费零食</div>
                <div className='tip'>每日领1款，天天0元享</div>
                <div className='contaier'>
                    <ul className='contaier-con contaier-con01'>
                        {
                            List01.map((item, index) => <li key={index} className="con-t">
                                <img src={item.listImages} alt={item.name} />
                                <div className='goods-name'>{item.name}</div>
                                <div className='title_01'>{item.displayName}</div>
                                <div className='title_02'>￥{item.retailPrice}</div>
                                <div className='goods-but'>{item.buyCartNum}元领</div>
                            </li>)
                        }
                    </ul>
                </div>
                <div className='tip'>限量供应，购物满99可享</div>
                <div className='contaier'>
                    <ul className='contaier-con'>
                        {
                            List02.map((item, index) => <li key={index} className="con-t">
                                <img src={item.listImages} alt={item.name} />
                                <div className='goods-name'>{item.name}</div>
                                <div className='title_01'>{item.displayName}</div>
                                <div className='title_02'>￥{item.retailPrice}</div>
                                <div className='goods-but'>{item.buyCartNum}元领</div>
                            </li>)
                        }
                    </ul>
                </div>
                <div className='tip'>限量供应，购物满149可享</div>
            </div>
        </div>
    )

}
export default Ceo;
